<?php
/**
 * 商品导出 入库凭证字段
 */

namespace Beike\Admin\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;

class ProductSkusExportStorageVoucherSimple extends JsonResource
{
    public function toArray($request): array
    {
        $data = [
            'id_en'                    => $this->id,
            'imagen_en'                => $this->image?image_resize($this->image):"",
            'product_description_en'   => $this->description->name,
            'sku'                   => $this->sku,
            'precio_en'                => currency_format($this->price),
            'quantity_en'              => $this->quantity,
            'total_en'                 => currency_format($this->price * $this->quantity),
            'change_en'                => '',
        ];

        return hook_filter('resource.product.export.storage_voucher.simple', $data);
    }
}
